import type { EnergyDiscountInfo, EnergyDiscountSaveOrUpdateParams } from '@/types'

const controller = getAjaxBaseUrl('/energyDiscount')

/** 创建或更新能源折标系数信息 */
export function saveOrUpdate(params: Partial<EnergyDiscountSaveOrUpdateParams>) {
  return post(`${controller}/saveOrUpdateDiscount`, params)
}

/** 查询能能折标系数列表 */
export function queryList() {
  return get<EnergyDiscountInfo[]>(`${controller}/queryList`)
}

/** 删除能能折标系数信息 */
export function deleteById(id: number) {
  return get(`${controller}/deleteDiscount`, { id })
}
